<?php
use yii\helpers\Url;
use yii\bootstrap\Html;
use kartik\grid\GridView;

return [

    [
        'class' => 'kartik\grid\CheckboxColumn',
        'rowSelectedClass' => GridView::TYPE_INFO,
        'checkboxOptions' => function($model){
        	if($model->QRcode != null)
        		return ['style'=>'visibility:hidden;'];
        },
        'width' => '20px',
    ],
   /* [
        'class' => 'kartik\grid\SerialColumn',
        'width' => '30px',
    ],*/
    [
        'class'=>'\kartik\grid\DataColumn',
        'attribute'=>'sid',
        'width'=>'50px',
    ],
    [
        'class'=>'\kartik\grid\DataColumn',
        'attribute'=>'name',     
    ],
    [
        'class'=>'\kartik\grid\DataColumn',
        'attribute'=>'tips',
    ],
    [
        'class'=>'\kartik\grid\DataColumn',
        'attribute'=>'price_base',
        'width'=>'150px',
    ],
    [
        'class'=>'\kartik\grid\DataColumn',
        'attribute'=>'price_custom',
        'width'=>'150px',
    ],
    // [
        // 'class'=>'\kartik\grid\DataColumn',
        // 'attribute'=>'related_list',
    // ],
    // [
        // 'class'=>'\kartik\grid\DataColumn',
        // 'attribute'=>'app_return',
    // ],
    // [
        // 'class'=>'\kartik\grid\DataColumn',
        // 'attribute'=>'pos_type',
    // ],
    // [
        // 'class'=>'\kartik\grid\DataColumn',
        // 'attribute'=>'img_small_id',
    // ],
    // [
        // 'class'=>'\kartik\grid\DataColumn',
        // 'attribute'=>'img_thumb_id',
    // ],
    // [
        // 'class'=>'\kartik\grid\DataColumn',
        // 'attribute'=>'img_url_id',
    // ],
    // [
        // 'class'=>'\kartik\grid\DataColumn',
        // 'attribute'=>'space_id',
    // ],
    // [
        // 'class'=>'\kartik\grid\DataColumn',
        // 'attribute'=>'top_time',
    // ],
[
'class' => 'kartik\grid\ActionColumn',
'header' => '查看',
'dropdown' => false,
'vAlign'=>'middle',
'template' => '{view}',
    						'urlCreator' => function($action, $model, $key, $index) {
    						return Url::to([$action,'id'=>$key]);
    						},
    						'viewOptions'=>['role'=>'modal-remote','title'=>'View','data-toggle'=>'tooltip'],
    								'updateOptions'=>['role'=>'modal-remote','title'=>'Update', 'data-toggle'=>'tooltip'],
    								'deleteOptions'=>['role'=>'modal-remote','title'=>'Delete',
    								'data-confirm'=>false, 'data-method'=>false,// for overide yii data api
    								'data-request-method'=>'post',
    								'data-toggle'=>'tooltip',
    								'data-confirm-title'=>'Are you sure?',
    								'data-confirm-message'=>'Are you sure want to delete this item'],
    ],
    [
        'class' => 'kartik\grid\ActionColumn',
        'header' => '销售属性',
        'dropdown' => false,
        'vAlign'=>'middle',
        'template' => '{update-pos}',
        'buttons' =>[
        	'update-pos' => function ($url,$model){     	
        		return	Html::a('<span class="glyphicon glyphicon-pencil"></span>',$url,['role'=>'modal-remote','title'=>'View','data-toggle'=>'tooltip']);
    				}
            	],
        'urlCreator' => function($action, $model, $key, $index) { 
                return Url::to([$action,'id'=>$key]);
        },

    ],
   //suiyue  2018/4/14 添加生活方式
  [
    'class' => 'kartik\grid\ActionColumn',
    'header' => '生活方式',
    'dropdown' => false,
    'vAlign'=>'middle',
    'template' => '{update-lifestyle}',
    'buttons' =>[
    		'update-lifestyle' => function ($url,$model){
    			
    			return Html::a('<span class="glyphicon glyphicon-pencil"></span>',"#",[
    					'title' => '修改','onClick'=>"javascript:window.open('".Url::to($url)."','','width=1200,height=600,top=100,left=300')",
    			]);
    			
    		}
    ],
    'urlCreator' => function($action, $model, $key, $index) {
    	return Url::to([$action,'id'=>$key]);
    },
    
    ],

];   